<div class="tpl-content-page-title">会员充值</div>
<ol class="am-breadcrumb">
	<li><a href="#" class="am-icon-home">首页</a></li>
	<li><a href="#">云造型会员</a></li>
	<li class="am-active">会员充值</li>
</ol>
<div class="tpl-portlet-components">
	<div class="portlet-title">
		 <div class="caption font-green bold">
			<span class="am-icon-code"></span> 会员充值
		</div> 

	</div>
	<div class="tpl-block ">

		<div class="am-g tpl-amazeui-form">

			<div class="am-u-sm-12 am-u-md-9">
				<form class="am-form am-form-horizontal">
					<div class="am-form-group">
						<label for="member-name" class="am-u-sm-3 am-form-label">会员名称
							</label>
						<div class="am-u-sm-9">
							<input type="text" id="member-name" placeholder="请输入会员名称">
						</div>
					</div>
					
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">手机号码
							</label>
						<div class="am-u-sm-9">
							<input type="text" id="member-mobile">
						</div>
					</div>
					
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">账户余额
							</label>
						<div class="am-u-sm-9">
							<input type="text" id="member-account">
						</div>
					</div>
					
					<div class="am-form-group">
						<label for="user-name" class="am-u-sm-3 am-form-label">充值金额
							</label>
						<div class="am-u-sm-9">
							<input type="text" id="member-money" placeholder="请输入充值金额">
						</div>
					</div>
					
					<div class="am-form-group">
						<div class="am-u-sm-9 am-u-sm-push-3">
							<button type="button" class="am-btn am-btn-cancel">返回列表</button>
							<button type="button" class="am-btn am-btn-recharge">提交充值</button>
						</div>
					</div>
				</form>
			</div>
		</div>
	</div>
</div>

<script type="text/javascript">
// 文档就绪函数
$(function(){
	doInitPage();	
	$(".am-btn-cancel").click(doCancel)
	$(".am-btn-recharge").click(doRecharge)
})

//提交充值信息
function doRecharge(){
	// 请求参数
	var url = "member/doMemberRecharge"
	
	var account =$("#member-account").val();
	var money = $("#member-money").val();
	var mobile = $("#member-mobile").val();
	
	// 发送请求
	var params = {"account":account,"money":money,"mobile":mobile}
	
	$.post(url,params,function(result){
		if(result.state==1){
			alert(result.message);
			doCancel();
		}else{
			alert("充值失败")
		}
	});
}

// 返回会员页面
	function doCancel(){
		$(".tpl-content-wrapper").load("member-info.html");
	}

// 初始化充值页信息
function doInitPage(){
	var data=$(".tpl-content-wrapper").data("data");
	
	$("#member-name").val(data.memberName);
	$("#member-mobile").val(data.mobile);
	
	$("#member-account").val(data.account);
}


</script>














